package com.itheima;

import com.itheima.autoconfig.aip.AipFaceProperties;
import com.itheima.autoconfig.aip.AipFaceTemplate;
import com.itheima.autoconfig.huanxin.HuanXinProperties;
import com.itheima.autoconfig.huanxin.HuanXinTemplate;
import com.itheima.autoconfig.huaweiyun.HuaWeiUGCProperties;
import com.itheima.autoconfig.huaweiyun.HuaWeiUGCTemplate;
import com.itheima.autoconfig.oss.OssProperties;
import com.itheima.autoconfig.oss.OssTemplate;
import com.itheima.autoconfig.sms.SmsProperties;
import com.itheima.autoconfig.sms.SmsTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration  // 声明此类是一个配置类
@Import({
        SmsProperties.class,//加载短信配置
        OssProperties.class,
        AipFaceProperties.class,
        HuanXinProperties.class,//加载环信配置
        HuaWeiUGCProperties.class//加载华为云配置
})
public class TanhuaAutoConfiguration {
    @Bean //当此类加载时 将方法所创建的对象 放入到容器中
    public SmsTemplate smsTemplate(SmsProperties smsProperties) {
        return new SmsTemplate(smsProperties);
    }


    //oss存储对象
    @Bean
    public OssTemplate ossTemplate(OssProperties ossProperties) {
        return new OssTemplate(ossProperties);
    }

    @Bean //人脸识别对象
    public AipFaceTemplate aipFaceTemplate(AipFaceProperties aipFaceProperties) {
        return new AipFaceTemplate(aipFaceProperties);
    }
    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties huanXinProperties) {
        return new HuanXinTemplate(huanXinProperties);
    }

    @Bean
    public HuaWeiUGCTemplate huaWeiUGCTemplate(HuaWeiUGCProperties huaWeiUGCProperties) {
        return new HuaWeiUGCTemplate(huaWeiUGCProperties);
    }
}